/**
 * Description:
 * Class Name:ImmutableStringTest
 * Date:2022/1/29 13:12
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第6章_面向对象_下._6_4_final修饰符;

public class ImmutableStringTest {
    public static void main(String[] args) {
        var str1 = new String("hello");
        var str2 = new String("hello");
        System.out.println(str1 == str2);           // 输出false
        System.out.println(str1.equals(str2));      // 输出true

        System.out.println(str1.hashCode());
        System.out.println(str2.hashCode());
    }
}
